/*
 * orderinfo.h
 *
 *  Created on: 2013-2-14
 *      Author: panqiuhui
 */

#ifndef ORDERINFO_H_
#define ORDERINFO_H_

#define ORDERS_USERNAME_LEN 30
#define ORDERS_ORDERID_LEN 11
#define ORDERS_TRAINID_LEN 10
#define ORDERS_COMPARTMENTNUM_LEN 4
#define ORDERS_SEATNUM_LEN 4
#define ORDERS_NAME_LEN 30
#define ORDERS_CREDIT_TYPE_LEN 45
#define ORDERS_CREDIT_ID_LEN 45
#define ORDERS_DEPARTDATE_LEN 11
#define ORDERS_DEPART_STATION_LEN 45
#define ORDERS_ARRIVE_STATION_LEN 45
#define ORDERS_BUY_DATE_LEN 11
#define ORDERS_PRICE 11

enum {
	TYPE_SEARCH_ORDER, TYPE_REFUND_ORDER
};

enum {
	ORDER_SEARCH_TYPE_BUY_DATE = 0, ORDER_SEARCH_TYPE_DEPART_DATE
};

struct orderinfo {
	char orderID[ORDERS_ORDERID_LEN];
	char trainID[ORDERS_TRAINID_LEN];
	char compartmentNum[ORDERS_COMPARTMENTNUM_LEN];
	char seatNum[ORDERS_SEATNUM_LEN];
	char name[ORDERS_NAME_LEN];
	char creditType[ORDERS_CREDIT_TYPE_LEN];
	char creditID[ORDERS_CREDIT_ID_LEN];
	char departDate[ORDERS_DEPARTDATE_LEN];
	char departStation[ORDERS_DEPART_STATION_LEN];
	char arriveStation[ORDERS_ARRIVE_STATION_LEN];
	char buyDate[ORDERS_BUY_DATE_LEN];
	char price[ORDERS_PRICE];
};

struct orderinfo_search_request {
	int order_search_type;
	char username[ORDERS_USERNAME_LEN];
	char startdate[ORDERS_DEPARTDATE_LEN];
	char enddate[ORDERS_DEPARTDATE_LEN];
	char orderID[ORDERS_ORDERID_LEN];
	char trainID[ORDERS_TRAINID_LEN];
};

struct orderinfo_refund_request {
	char username[ORDERS_USERNAME_LEN];
};

struct orderinfo_request_type {
	int type;
};

#endif /* ORDERINFO_H_ */
